package chapter11;

class NewThreadJoin implements Runnable{
	
	String name; //Name of thread
	Thread t;
	
	public NewThreadJoin(String threadname) {
		name = threadname;
		t = new Thread(this, name);
		System.out.println("New Thread: " + t);
		t.start();
	}
	
	public void run(){		
		try{
			for(int i = 5; i > 0; i--){
				System.out.println("name : " + i);
				Thread.sleep(1000);
			}
		}catch(InterruptedException e){
			System.out.println("Exiting : " + name);
		}	
	}
	

}
